<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<html:html>
<head>
<html:base />
<title><bean:message key="Application.Name"/></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="css/formas.css" rel="stylesheet" type="text/css">
<script LANGUAGE="JavaScript" type="text/javascript" src="js/AnchorPosition.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/PopupWindow.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/date.js"></script>
<script LANGUAGE="JavaScript" type="text/javascript" src="js/CalendarPopup.js"></script>
<script language="javascript" type="text/javascript" src="js/util.js"></script>
<script language="javascript" type="text/javascript">
	function fnc_validarForma(forma){
		var bol_retVal = true;
		var str_errores = "";
		
		if(Trim(forma.int_subtopicNumber.value)==""){
			str_errores += " - <bean:message key='Subtema'/> <bean:message key='errors.required'/>\n";
		}else{
			if(!esNumero(forma.int_subtopicNumber.value,0)){
				str_errores += " - <bean:message key='Subtema'/> <bean:message key='errors.integer'/>\n";
			}
		}
		if(Trim(forma.str_descripcion.value)==""){
			str_errores += " - <bean:message key='Document.description'/> <bean:message key='errors.required'/>\n";
		}
		if(Trim(forma.str_objetivos.value)==""){
			str_errores += " - <bean:message key='Subtema.objectives'/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.objetivoAlumno.value ) == "" ){
			str_errores += " - <bean:message key='StudyPlan.content.descriptiveLetter.studentGoal'/> <bean:message key='errors.required'/>\n";
		}
		if( !fnc_validarRadioButton( forma.tipo ) ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.type"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.experienciaAprendizaje.value ) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.expertice"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.material.value ) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.material"/> <bean:message key='errors.required'/>\n";
		}
		if( forma.nivelConocimiento.selectedIndex == 0 ){
			str_errores += " - <bean:message key='StudyPlan.content.descriptiveLetter.selectLevel'/>\n";
		}
		if( Trim( forma.ejecucionEspecifica.value ) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.especificExec"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.producto.value ) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.product"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.procedimientoEvaluar.value ) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.evalProcedure"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.ejecucionAceptable.value ) == "" ){
			str_errores += " - <bean:message key="StudyPlan.content.descriptiveLetter.acceptedExec"/> <bean:message key='errors.required'/>\n";
		}
		if( Trim( forma.tiempoMinimo.value ) == "" ){
			str_errores += " - <bean:message key='StudyPlan.content.descriptiveLetter.minimalTime'/> <bean:message key='errors.required'/>\n";
		}else{
			var int_numeroVa = Trim(forma.tiempoMinimo.value);
			if( int_numeroVa != "" && (!esNumero(int_numeroVa,0) || parseInt(int_numeroVa) < 0) ){
				str_errores += " - <bean:message key='StudyPlan.content.descriptiveLetter.minimalTime'/> <bean:message key='errors.integer'/>\n";
			}
		}
		if( Trim( forma.grupo.value ) == "" ){
			str_errores += " - <bean:message key='StudyPlan.content.descriptiveLetter.group'/> <bean:message key='errors.required'/>\n";
		}else{
			int_numeroVa = Trim(forma.grupo.value);
			if( int_numeroVa != "" && (!esNumero(int_numeroVa,0) || parseInt(int_numeroVa) < 0) ){
				str_errores += " - <bean:message key='StudyPlan.content.descriptiveLetter.group'/> <bean:message key='errors.integer'/>\n";
			}
		}
		if( str_errores != "" ){
			bol_retVal = false;
			alert( " <bean:message key='Application.Error(s)'/> : \n" + str_errores );
		}
		return bol_retVal;
	}
	<logic:present name="req_msg">
		alert("<bean:write name='req_msg'/>");
	</logic:present>
</script>
<style type="text/css">
#div_cal {
	background-color:#FF9933;
	position:absolute;
}
</style>
</head>
<body>
	<table cellpadding="0" cellspacing="0" class="formas">
    	<tr>
        	<td>
		   	<table cellpadding="0" cellspacing="0" class="barraNavegacion">
       			<tr>
       			<td><html:link action="/academy_welcome?action=selectAcademy" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="AcademyWelcome.Init"/></html:link>
			        		<html:link action="/academy_list" styleClass="barraNavegacion"><img src="images/icn_liga.gif" border="0"><bean:message key="Menu.AcademyHeader"/></html:link>
			        		<html:link action="/subject_list" styleClass="barraNavegacion" name="academia" property="map_id"><img src="images/icn_liga.gif" border="0"><bean:message key="StudyPlan.subjects"/></html:link>
			        		<html:link action="/contents_list" styleClass="barraNavegacion" name="materia" property="map_id"><img src="images/icn_liga.gif" border="0"><bean:message key="StudyPlan.subjects.contents"/></html:link>
			        		<html:link  action="/unit_list" styleClass="barraNavegacion" name="materia" property="map_id" ><img src="images/icn_liga.gif" border="0"><bean:message key="Units"/></html:link>
			        		<html:link  action="/topic_lista" styleClass="barraNavegacion" name="tema" property="map_id" ><img src="images/icn_liga.gif" border="0"><bean:message key="Units.themes"/></html:link>
			        		<html:link  action="/subtopic_lista" styleClass="barraNavegacion" name="tema" property="map_id" ><img src="images/icn_liga.gif" border="0"><bean:message key="Tema.subtopic"/></html:link>
		        </td>
		    </table>
		  	<table cellpadding="0" cellspacing="0" class="titulo">
	        	<tr>
	            	<td class="iconos_imgs"><a href="mailto:<bean:message key="Application.mailto"/>"><img src="images/icn_correo.gif" width="18" height="18" border="0"></a></td>
	               	<td class="txt_titulo"><bean:message key="Subtema.content"/></td>
		      	</tr>
          	</table>
 			<html:form action="/subtopic_save" onsubmit="return fnc_validarForma(this);">	       
	 			<input type="hidden" name="subject_id" value="<bean:write name="materia" property="codigo"/>"/>
		        <input type="hidden" name="academy_id" value="<bean:write name="academia" property="codigo"/>"/>
		        <input type="hidden" name="unit_id" value="<bean:write name="unidad" property="int_unitId"/>"/>
		        <input type="hidden" name="topic_id" value="<bean:write name="tema" property="int_topicId"/>"/>
			<table cellpadding="0" cellspacing="2" class="info_formas">
        		<tr> 
          			<td class="formas-txtInfo"><bean:message key="Tema.instructions"/></td>
        		</tr>
        		<table cellpadding="0" cellspacing="2" class="info_titulo">
        			<tr> 
						<td class="formas-encabezado"><bean:message key="StudyPlan.subject.subjectData"/></td>
					</tr>
           			<tr> 
						<td>						
							<table cellpadding="0" cellspacing="2" class="info_titulo">
								<tr> 
									<td class=""><strong><bean:message key="StudyPlan.subject"/></strong></td>
									<td class=""><bean:write name="materia" property="codigo"/> - <bean:write name="materia" property="nombre"/></td>
								</tr>
								<tr> 
									<td class=""><strong><bean:message key="AcademyWelcome.Academy"/></strong></td>
									<td class=""><bean:write name="academia" property="codigo"/> - <bean:write name="academia" property="nombre"/></td>
								</tr>	
								<tr> 
									<td class=""><strong><bean:message key="Unit"/></strong></td>
									<td class=""><bean:write name="unidad" property="int_unitId"/> - <bean:write name="unidad" property="str_descripcion"/></td>
								</tr>	
								<tr> 
									<td class=""><strong><bean:message key="Tema"/></strong></td>
									<td class=""><bean:write name="tema" property="int_topicId"/> - <bean:write name="tema" property="str_descripcion"/></td>
								</tr>				
		            		</table>
	          			<td> 
					</tr>
					<tr> 
						<td class="formas-encabezado"><bean:message key="Subtema.add"/></td>
					</tr>
					<tr> 
						<td colspan="3" align="center">
							<table cellpadding="0" cellspacing="2" class="info_titulo">
								<tr> 
									<td class="" ><bean:message key="Subtema"/></td>
									<td class="" colspan="5">
										<html:text property="int_subtopicNumber" size="8"/>
									</td>
								</tr>
								<tr> 
									<td class=""><bean:message key="Subtema.description"/></td>
									<td>
										<html:text property="str_descripcion" size="55" maxlength="150"/>							
									</td>
								</tr>
								<tr>
                    				<td><bean:message key="Subtema.objectives"/></td>
				                    <td><html:textarea property="str_objetivos" cols="50" rows="3"/></td>
                				</tr>
                				<tr> 
							<td colspan="2" class="formas-encabezado"><bean:message key="StudyPlan.subject.DescriptiveLetter"/></td>
						</tr>
						<tr> 
							<td colspan="2" align="center">
								<table cellpadding="0" cellspacing="2" class="info_titulo">								
									<tr> 
										<td width="25%"><bean:message key="StudyPlan.content.descriptiveLetter.studentGoal"/></td>
										<td colspan="3"><html:textarea property="objetivoAlumno" cols="50" rows="4"></html:textarea></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.type"/></td>
										<td colspan="3">
											<html:radio property="tipo" value="E">E</html:radio>
											<html:radio property="tipo" value="C">C</html:radio>
											<html:radio property="tipo" value="A">A</html:radio>
										</td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.expertice"/></td>
										<td colspan="3"><html:textarea property="experienciaAprendizaje" cols="50" rows="4"></html:textarea></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.material"/></td>
										<td colspan="3"><html:textarea property="material" cols="50" rows="4"></html:textarea></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.knowledgeLevel"/></td>
										<td colspan="3">
											<html:select property="nivelConocimiento">
												<html:option value=""><bean:message key="StudyPlan.content.descriptiveLetter.selectLevel"></bean:message></html:option>
												<html:options collection="niveles" property="codigo" labelProperty="descripcion"/>
											</html:select>
										</td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.especificExec"/></td>
										<td colspan="3"><html:text property="ejecucionEspecifica" size="50" maxlength="60"/></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.product"/></td>
										<td colspan="3"><html:text property="producto" size="50" maxlength="60"/></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.evalProcedure"/></td>
										<td colspan="3"><html:textarea property="procedimientoEvaluar" cols="50" rows="3"></html:textarea></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.acceptedExec"/></td>
										<td colspan="3"><html:text property="ejecucionAceptable" size="50" maxlength="60"/></td>
									</tr>
									<tr> 
										<td><bean:message key="StudyPlan.content.descriptiveLetter.minimalTime"/></td>
										<td><html:text property="tiempoMinimo" size="8" maxlength="8"/></td>
										<td><bean:message key="StudyPlan.content.descriptiveLetter.group"/></td>
										<td><html:text property="grupo" size="8" maxlength="8"/>%</td>
									</tr>
								<tr> 
								<tr> 
									<td colspan="6" align="center">
										<div align="center">
											<html:submit property="btn_aceptar"><bean:message key="Application.Accept" /></html:submit>
											<input type="button" onclick="location.href='<html:rewrite action="/subtopic_lista" name="tema" property="map_id"/>';" value="<bean:message key='Application.Cancel'/>"/>
										</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</html:form>
		</td>
		</table>
	</td>
	</tr>
</table></td>
</body>
</html:html>
